package com.ethan.threadPool.Servcie;

import lombok.*;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * @author ethan
 * create 2018-07-30 下午5:21
 * desc
 **/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BaseDataResponse implements Serializable{
    private static final long serialVersionUID = -1L;

    public enum BaseDataType{
        FLIGHT,
        INSURANCE;
    }

    private boolean success;
    private BaseDataType baseDataType;
    private Object baseData;

    public static BaseDataResponse buildBaseDataResponse(BaseDataType baseDataType,Object baseData){
        return BaseDataResponse.builder().success(true).baseDataType(baseDataType).baseData(baseData).build();
    }


    @Override
    public String toString(){
        return ToStringBuilder.reflectionToString(this);
    }
}
